<template>
  <div class="address">
    <van-nav-bar title="收货地址" left-text="返回" left-arrow @click-left="goback()" />
    <!-- <van-button
      class="addr"
      color="#01D5D8"
      type="primary"
      size="large"
      to="/usermy/address/addressNode"
    >新增地址</van-button> -->

    <van-address-list
      v-model="chosenAddressId"
      :list="list"
 @add="onAdd"
    />
  </div>
</template>

<script>
export default {
  name: '',
  data: () => ({
    chosenAddressId: '1',
    item: '',
    list: []
  }),
  methods: {
    goback() {
      this.$router.go(-1)
    },
    onAdd() {
      this.$router.push('/usermy/address/addressNode')
    }
  },
  created() {
    this.list = JSON.parse(localStorage.getItem('address'))
  }
}
</script>

<style lang="less" scoped>
.address {
  width: 100%;
  position: relative;
  .addr {
    width: 360px;
    margin-left: 8px;
    background: #01d5d8;
    color: #fff;
    text-align: center;
    font-weight: bolder;
    border-radius: 3px;
    position: absolute;
    top: 562px;
  }
}
</style>
